<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
<script>
  // TODO: 如何识别浏览器的类型
  // TODO: 分析拆解url各个部分

  // navigator
  const ua = navigator.userAgent;
  const isChrome = ua.indexOf('Chrome');
  console.log(ua);
  
  // screen
  screen.width;
  screen.height;

  // location
  location.href;
  location.protocol;
  location.host;
  location.search; // ?a=1&b=2
  location.hash;
  location.pathname;

  // history
  // history.back(); // 后退
  // history.forward(); // 前进
</script>
</body>
</html>